/**
 * Created by Administrator on 2017/12/18 0018.人事招聘
 */
import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({
  app,
  models: () => models.map(m => import(`../models/${m}.js`)),
  component,
});


export const AttendanceManagement = (app) => {
  return {
    name: '考勤管理',
    icon: 'kaoqinguanli',
    path: 'attendancemanagement',
    children: [
      {
        name: '班次管理',
        path: 'newshift1',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/NewShift')),
      },
      {
        name: '考勤组管理',
        path: 'newattendanceunit',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/NewAttendanceUnit')),
      },
      {
        name: '',//设置考勤人员
        path: 'settingupattendance',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/SettingUpAttendance')),
      },
      {
        name: '',//选择考勤类型
        path: 'selectionattendancetype',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/SelectionAttendanceType')),
      },
      {
        name: '',//排班设置
        path: 'schedulesetting',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/ScheduleSetting')),
      },
      {
        name: '',//考勤方式
        path: 'choosewayattendance',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/ChooseWayAttendance')),
      },
      {
        name: '',//完成
        path: 'settingcomplete',
        component: dynamicWrapper(app, ['monitor'], () => import('../routes/AttendanceManagement/SettingComplete')),
      },
    ],
  };
};
